using Godot;
using RPG01.Scripts.SateMachine;

namespace RPG01.Scripts.Character.Player;

public class PlayerIdleState : State
{
    public PlayerIdleState(Player player, StateMachine stateMachine) : base(player, stateMachine)
    {
    }
    
    public override void Enter()
    {
        base.Enter();
        player.PlayAnimation("idle");
    }

    public override void Process(double delta)
    {
        base.Process(delta);
        if (Input.IsActionJustPressed("jump"))
        {
            stateMachine.SwitchState<PlayerJumpState>();
        }
    }

    public override void PhysicsProcess(double delta)
    {
        base.PhysicsProcess(delta);
        
        if (player.GetMoveInput() != Vector2.Zero)
        {
            stateMachine.SwitchState<PlayerMoveState>();
            return;
        }
    }

    public override void Exit()
    {
        base.Exit();
    }

    
}